import env from '../../build/env'

// const SERVER_DOMAIN = env === 'development' ? 'localhost:8080' : env === 'production' ? 'www.51dzzs.com' : 'debug.url.com'
const SERVER_DOMAIN = 'www.51dzzs.com'

const SERVER_HOST = '//' + SERVER_DOMAIN + '/'

const API = {
  LOGIN: '/base/user/login',
  USER_LIST: '/base/user/list',
  USER_SAVE: '/base/user/save',
  USER_DETAIL: '/base/user/detail',

  ROLE_LIST: '/base/role/list',
  ROLE_SAVE: '/base/role/save',
  ROLE_DETAIL: '/base/role/detail',

  MENU_LIST: '/base/menu/list',
  MENU_SAVE: '/base/menu/save',
  MENU_DETAIL: '/base/menu/detail',

  THEME_SAVE: '/busine/theme/save',

  DIPLOMAS_SAVE: '/busine/diplomas/save',

  UPLOAD_FILE: '/upload/uploadFile',

  SEAL_SAVE: '/busine/chapter/save',
  MEMBER_SAVE: '/busine/theme/member/saveMember',

  GET_MEMBER_BY_THEME: '/busine/theme/member/getMemberByTheme',
  GET_DIPLOMA_BY_THEME: '/busine/diplomas/findByTheme',

  TEMPLATE_LIST: '/busine/model/findAll',
  ORG_LIST: '/busine/organize/findAll'
}

const output = {}

for (let key in API) {
  output[key] = SERVER_HOST + API[key]
  // output[key] = /* SERVER_HOST + */API[key]
}

output['SERVER_DOMAIN'] = SERVER_DOMAIN
output['SERVER_HOST'] = SERVER_HOST
output['LOCAL_HOST'] = env === 'development'
  ? 'http://localhost:8081'
  : env === 'production'
    ? 'http://www.51dzzs.com'
    : 'debug.url.com'
export default output
